package com.itheima.health.controller;

import com.itheima.health.common.MessageConst;
import com.itheima.health.entity.Result;
import com.itheima.health.pojo.Setmeal;
import com.itheima.health.service.MobileService;
import com.itheima.health.service.SetmealService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/mobile")
public class MobileController {
    @Resource
    private MobileService mobileService;
    @Resource
    private SetmealService setmealService;
    @GetMapping("/setmeal/getSetmeal")
    public Result getSetmeal(){
        List<Setmeal> setmealList = setmealService.getMeal();
        return new Result(true, MessageConst.GET_SETMEAL_COUNT_REPORT_SUCCESS,setmealList);
    }
    @GetMapping("/setmeal/findById")
    public Result findById(Integer id){
        Setmeal setmeal = setmealService.findById(id);
        return new Result(true,MessageConst.GET_SETMEAL_LIST_SUCCESS,setmeal);
    }
    @PostMapping("/order/submit")
    public Result submit(){

        return null;
    }
}
